package com.ssy.lingxi.product.service.customer;

import com.ssy.lingxi.common.model.dto.UserLoginCacheDTO;
import com.ssy.lingxi.common.model.vo.PageVO;
import com.ssy.lingxi.product.api.model.request.SimpleIdListRequest;
import com.ssy.lingxi.product.common.tree.AttributeNode;
import com.ssy.lingxi.product.entity.customer.CustomerAttribute;
import com.ssy.lingxi.product.model.request.CommodityGoodsAttributeRequest;
import com.ssy.lingxi.product.model.resp.CommodityGoodsAttributeAndBrandResponse;
import com.ssy.lingxi.product.model.resp.CommodityGoodsAttributeResponse;
import org.springframework.data.domain.Page;

import java.util.List;

/**
 * 属性管理类
 * @author jw.chen
 * @version 2.0.0
 * @date 2020/6/23
 */
public interface ICustomerAttributeService {

    /**
     * 同步平台后台属性
     * @return
     */
    Boolean syncAttribute(UserLoginCacheDTO sysUser, SimpleIdListRequest simpleIdListRequest);

    /**
     * 查询属性树
     * @return Wrapper<?>
     */
    List<AttributeNode> getCustomerAttributeTree(UserLoginCacheDTO sysUser, Boolean filterInput);

    /**
     * 查询属性
     * @param pageVO
     * @param name
     * @return Wrapper<?>
     */
    Page<CustomerAttribute> getCustomerAttributeList(UserLoginCacheDTO sysUser, PageVO pageVO, String name);

    /**
     * 查询属性
     * @param customerAttributeId
     * @return Wrapper<?>
     */
    CustomerAttribute getCustomerAttribute(UserLoginCacheDTO sysUser, Long customerAttributeId);

    /**
     * 添加/修改属性
     * @param customerAttribute
     * @return
     * @throws Exception
     */
    String saveOrUpdateCustomerAttribute(UserLoginCacheDTO sysUser, CustomerAttribute customerAttribute);

    /**
     * 删除属性
     * @param customerAttributeId
     * @return
     */
    String deleteCustomerAttribute(UserLoginCacheDTO sysUser, Long customerAttributeId);

    /**
     * 启用/停用属性
     * @param id
     * @param status
     * @return
     */
     String updateCustomerAttributeStatus(UserLoginCacheDTO sysUser, Long id, Boolean status);

    /**
     * 获取可选的属性
     * @param commodityGoodsAttributeRequest
     * @return
     */
    CommodityGoodsAttributeAndBrandResponse getEffectiveAttribute(CommodityGoodsAttributeRequest commodityGoodsAttributeRequest);
}
